package collection;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;

class User {
    private String name;

    public User(String name) {
        this.name = name;
    }
}

public class MapMemoryDemo {
    public final static int NUM = 1_000_000;

    public static void main(String[] args) throws InterruptedException {
        Map<Integer, User> map = new HashMap<>(NUM);
        for (int i = 0; i < NUM; i++) {
            map.put(i, new User(String.valueOf(i)));
        }
        System.out.println("ready");
        TimeUnit.MILLISECONDS.sleep(NUM);
    }
}
